package com.huirui.server.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "商品详情视图对象，包含商品的基本信息和规格信息")
public class ProductDetailVo {

    @Schema(description = "商品ID", example = "1001", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Long id;

    @Schema(description = "商品名称", example = "智能手机Pro", requiredMode = Schema.RequiredMode.REQUIRED)
    private String productName;

    @Schema(description = "商品类型")
    private Long productType;

    @Schema(description = "商品小贴士/简短描述", example = "高性能处理器，超长待机", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String productTip;

    @Schema(description = "品牌名称", example = "科技先锋", requiredMode = Schema.RequiredMode.REQUIRED)
    private String brandName;

    @Schema(description = "品牌ID")
    private Long brandId;

    @Schema(description = "轮播图URL，多个URL用逗号分隔", example = "https://example.com/img1.jpg,https://example.com/img2.jpg", requiredMode = Schema.RequiredMode.REQUIRED)
    private String bannerImageUrls;

    @Schema(description = "详情图URL，多个URL用逗号分隔", example = "https://example.com/detail1.jpg,https://example.com/detail2.jpg", requiredMode = Schema.RequiredMode.REQUIRED)
    private String detailImageUrls;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "秒杀开始时间")
    private LocalDateTime seckillStartTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "秒杀结束时间")
    private LocalDateTime seckillEndTime;

    @Schema(description = "商品规格列表", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<ProductSpecificationVo> specificationVoList;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "生产日期")
    private LocalDate manufactureDate;

    @JsonFormat(pattern = "yyyy/MM/dd")
    @Schema(description = "过期时间")
    private LocalDate expirationDate;

    @Schema(description = "可用库存")
    private Long availableStock;

    @Schema(description = "总库存")
    private Long stock;
}
